home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / standard / stfe.z / stfe
Encoding:
Text File  |  2002-10-03  |  9.5 KB  |  177 lines

  1. STFE(3X)                                              Last changed: 11-5-98
  2.  
  3.  
  4. NNAAMMEE
  5.      ssttffee - Routines that provide a high-level interface to the symbol
  6.      table
  7.  
  8. SSYYNNOOPPSSIISS
  9.      ##iinncclluuddee <<ssyymmss..hh>>
  10.  
  11.      ""lloonngg sstt__ffiilleebbeeggiinn((cchhaarr **ffiilleennaammee));;
  12.  
  13.      ""lloonngg sstt__eennddaallllffiilleess((vvooiidd));;
  14.  
  15.      ""lloonngg sstt__ffiilleeeenndd((lloonngg iiddnn));;
  16.  
  17.      ""lloonngg sstt__bblloocckkbbeeggiinn((lloonngg iissss,, lloonngg vvaalluuee,, lloonngg sscc));;
  18.  
  19.      ""lloonngg sstt__tteexxttbblloocckk((vvooiidd));;
  20.  
  21.      ""lloonngg sstt__bblloocckkeenndd((lloonngg ssiizzee));;
  22.  
  23.      ""lloonngg sstt__pprroocceenndd((lloonngg iiddnn));;
  24.  
  25.      ""lloonngg sstt__pprrooccbbeeggiinn((lloonngg iiddnn));;
  26.  
  27.      ""cchhaarr **sstt__ssttrr__iiddnn((lloonngg iiddnn));;
  28.  
  29.      ""cchhaarr **sstt__ssyymm__iiddnn((lloonngg iiddnn,, lloonngg **sscc,, lloonngg **sstt,, lloonngg **vvaalluuee,, lloonngg
  30.      **iinnddeexx));;
  31.  
  32.      ""lloonngg sstt__aabbss__iiffdd__iinnddeexx((lloonngg iiffdd,, lloonngg iinnddeexx));;
  33.  
  34.      ""lloonngg sstt__ffgglloobbaall__iiddnn((lloonngg iiddnn));;
  35.  
  36.      ""ppSSYYMMRR sstt__ppssyymm__iiddnn__ooffffsseett((lloonngg iiddnn;; lloonngg ooffffsseett));;
  37.  
  38.      ""lloonngg sstt__ppddaadddd__iiddnn((lloonngg iiddnn));;
  39.  
  40. IIMMPPLLEEMMEENNTTAATTIIOONN
  41.      IRIX systems (o32 ABI only)
  42.  
  43. DDEESSCCRRIIPPTTIIOONN
  44.      The ssttffee routines provide a high-level interface to the symbol table
  45.      based on common needs of the compiler front-ends.
  46.  
  47.      _s_t__f_i_l_e_b_e_g_i_n
  48.              Takes a file name and calls _s_t__f_d_a_d_d (see the ssttffdd man page).
  49.              If it is a new file, a symbol is added to the symbol table for
  50.              it and the user supplied routine, sstt__ffeeiinniitt, is called.  This
  51.              allows special once per file things to be initialized (for
  52.              example, the C front-end adds basic type auxiliaries to each
  53.              file's aux table so that all variables of that type can refer
  54.              to a single instance instead of making individual copies of
  55.              them).  sstt__ffiilleebbeeggiinn returns a dense number that references
  56.              the symbol added for this file.  It tracks files as they
  57.              appear in a CPP line directive with a stack.  It detects (from
  58.              the order of the CPP directives) that a file ends and calls
  59.              sstt__ffiilleenndd.  If a file is closed with a sstt__ffiilleeeenndd, a new
  60.              instance of the filename is created (for example, multiply
  61.              included files).
  62.  
  63.      _s_t__f_i_l_e_e_n_d
  64.              Requires the dense number from the corresponding sstt__ffiilleebbeeggiinn
  65.              call for the file in question.  It then generates an end
  66.              symbol and patches the references so that the index field of
  67.              the begin file points to that of one beyond the end file.  The
  68.              end file points to the begin file.
  69.  
  70.      _s_t__e_n_d_a_l_l_f_i_l_e_s
  71.              Is called at the end of execution to close off all files that
  72.              have not been ended by previous calls to _s_t__f_i_l_e_b_e_g_i_n.  CPP
  73.              directives might not reflect the return to the original source
  74.              file; therefore, this routine can possibly close many files.
  75.  
  76.      _s_t__b_l_o_c_k_b_e_g_i_n
  77.              Supports language blocks (for example, C's left curly brace
  78.              blocks), beginning of structures, and unions.  If the storage
  79.              class is scText, it is the former; if it is scInfo, it is one
  80.              of the latter.  The iss (index into string space) specifies
  81.              the name of the structure/etc, if any.
  82.  
  83.      If the storage class is scText, we must check the result of
  84.      _s_t__b_l_o_c_k_b_e_g_i_n.  It returns a dense number for outer blocks and a zero
  85.      for nested blocks.  The non-zero block number should be used in the
  86.      BGNB ucode.  Users of languages without nested blocks that provide
  87.      variable declarations can ignore the rest of this paragraph.  Nested
  88.      blocks are two-staged: one stage happens when we detect the language
  89.      block and the other stage happens when we know the block has content.
  90.      If the block has content (for example, local variables), the front-end
  91.      must call _s_t__t_e_x_t_b_l_o_c_k to get a non-zero dense number for the block's
  92.      BGNB ucode. If the block has no content and _s_t__t_e_x_t_b_l_o_c_k is not
  93.      called, the block's _s_t__b_l_o_c_k_b_e_g_i_n and _s_t__b_l_o_c_k_e_n_d do not produce block
  94.      and end symbols.
  95.  
  96.      If it is scInfo, _s_t__b_l_o_c_k_b_e_g_i_n creates a begin block symbol in the
  97.      symbol table and returns a dense number referencing it.  The dense
  98.      number is necessary to build the auxiliary required to reference the
  99.      structure/etc. It goes in the aux after the TIR along with a file
  100.      index. This dense number is also noted in a stack of blocks used by
  101.      _s_t__b_l_o_c_k_e_n_d.
  102.  
  103.      _s_t__b_l_o_c_k_b_e_g_i_n should not be called for language blocks when the
  104.      front-end is not producing debugging symbols.
  105.  
  106.      _s_t__b_l_o_c_k_e_n_d requires that blocks occur in a nested fashion. It
  107.      retrieves the dense number for the most recently started block and
  108.      creates a corresponding end symbol. As in _f_i_l_e_e_n_d, both the begin and
  109.      end symbol index fields point at the other end's symbol.  If the
  110.      symbol ends a structure/etc., as determined by the storage class of
  111.      the begin symbol, the size parameter is assigned to the begin symbol's
  112.      value field.  It's usually the size of the structure or max value of a
  113.      enum.  We only know it at this point. The dense number of the end
  114.      symbol is returned so that the ucode ENDB can be use it.  If it is an
  115.      ignored text block, the dense number is zero and no ENDB should be
  116.      generated.
  117.  
  118.      In general, defined external procedures or functions appear in the
  119.      symbols table and the externals table. The external table definition
  120.      must occur first through the use of a _s_t__e_x_t_a_d_d.  After that
  121.      definition, _s_t__p_r_o_c_b_e_g_i_n can be called with a dense number referring
  122.      to the external symbol for that procedure. It checks to be sure we
  123.      have a defined procedure (by checking the storage class). It adds a
  124.      procedure symbol to the symbol table. The external's index should
  125.      point at its auxiliary data type information (or if debugging is off,
  126.      indexNil).  This index is copied into the regular symbol's index field
  127.      or a copy of its type is generated (if the external is in a different
  128.      file than the regular symbol).  Next, we put the index to symbol in
  129.      the external's index field. The external's dense number is used as a
  130.      block number in ucodes referencing it and is used to add a procedure
  131.      when in the _s_t__p_d_a_d_d__i_d_n.
  132.  
  133.      _s_t__p_r_o_c_e_n_d
  134.              Creates an end symbol and fixes the indices as in _b_l_o_c_k_e_n_d and
  135.              _f_i_l_e_e_n_d, except that the end procedure reference is kept in
  136.              the begin procedure's aux rather than in the index field
  137.              (because the begin procedure has a type as well as an end
  138.              reference). This must be called with the dense number of the
  139.              procedure's external symbol as an argument and returns the
  140.              dense number of the end symbol to be used in the END ucode.
  141.  
  142.      _s_t__s_t_r__i_d_n
  143.              Returns the string associated with symbol or external
  144.              referenced by the dense number argument. If the symbol was
  145.              anonymous (for example, there was no symbol) a (char *)-1 is
  146.              returned.
  147.  
  148.      _s_t__s_y_m__i_d_n
  149.              Returns the same result as _s_t__s_t_r__i_d_n, except that the rest of
  150.              the fields of the symbol specified by the _i_d_n are returned in
  151.              the arguments.
  152.  
  153.      _s_t__f_g_l_o_b_a_l__i_d_n
  154.              Returns a 1 if the symbol associated with the specified idn is
  155.              non-static; otherwise, a 0 is returned.
  156.  
  157.      _s_t__a_b_s__i_f_d__i_n_d_e_x
  158.              Returns the absolute offset for a dense number. If the symbol
  159.              is global, the global's index is returned. If the symbol
  160.              occurred in a file, the sum of all symbols in files occurring
  161.              before that file and the symbol's index within the file is
  162.              returned.
  163.  
  164.      _s_t__p_d_a_d_d__i_d_n
  165.              Adds an entry to the procedure table for the _s_t__p_r_o_c _e_n_t_r_y
  166.              generated by procbegin. This should be called when the front-
  167.              end generates code for the procedure in question.
  168.  
  169.      The programs must be loaded with the object file access routine
  170.      library libmld.a.
  171.  
  172. SSEEEE AALLSSOO
  173.      ssttccuu(3x), ssttffdd(3x)
  174.  
  175.      This man page is available only online.
  176.  
  177.